/**
 *
 *
 *
 *
 *
 */

package qky.admin.modules.customer.controller;


import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import qky.admin.modules.customer.entity.UserEntity;
import qky.admin.modules.customer.service.UserService;
import qky.admin.modules.sys.controller.AbstractController;
import qky.admin.modules.sys.service.SysUserService;
import qky.common.utils.PageUtils;
import qky.common.utils.R;

/**
 * 系统用户
 *
 *
 */
@RestController
@RequestMapping("/customer")
public class UserController extends AbstractController {
	@Autowired
	private UserService userService;
	
	@RequestMapping("/list")
	public R list(@RequestParam Map<String, Object> params){
		PageUtils page = userService.queryPage(params);
		return R.ok().put("page", page);
	} 
	
	@GetMapping("/updStatus")
	public R updStatus(String ids,Integer userStatus){
		for (String userId : ids.split(",")) {
			UserEntity user = new UserEntity();
			user.setUserId(Long.valueOf(userId));
			user.setUserStatus(userStatus);
			userService.updateById(user);
		}
		return R.ok();
	}
	
}
